<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link rel="icon" href="../chaos/image/icon.png" type="image/x-icon"/>
    <link rel="stylesheet" href="./layui/css/layui.css">
    <link rel="stylesheet" href="./css/common.css">
    <title>像素战争-修改信息</title>
</head>
<body>
<script src="js/jquery.min.js"></script>
<script src="./layui/layui.js"></script>
<script src="js/auth.js"></script>

<div>
    <div class="chaos-nav">
        <ul class="layui-nav layui-bg-green">
            <li class="layui-nav-item">
                <a href="javascript:window.location.href='index.html'">首页</a>
            </li>
            <li class="layui-nav-item">
                <a href="javascript:window.location.href='chat.html'">聊天室</a>
            </li>
            <li class="layui-nav-item" style="position: fixed;right: 60px">
                <a class="user-nick-name">我</a>
                <dl class="layui-nav-child">
                    <dd><a href="javascript:void(0);" onclick="userLogout()">退出</a></dd>
                </dl>
            </li>
        </ul>
    </div>
</div>

<div class="layui-row layui-col-space30">
    <div class="layui-panel authForm">
        <form class="layui-form" name="changeInfoForm">
            <div class="layui-form-item">
                <label class="layui-form-label">
                    <h2>修改信息</h2>
                </label>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">昵称</label>
                <div class="layui-input-block">
                    <input type="text" name="nickName" required lay-verify="required" placeholder="请输入昵称"
                           autocomplete="off"
                           class="layui-input">
                </div>
            </div>
<!--            <div class="layui-form-item">-->
<!--                <label class="layui-form-label">密码</label>-->
<!--                <div class="layui-input-inline">-->
<!--                    <input type="password" name="password" required lay-verify="required|length6" placeholder="请输入密码"-->
<!--                           autocomplete="off"-->
<!--                           class="layui-input">-->
<!--                </div>-->
<!--                <div class="layui-form-mid layui-word-aux">密码不小于6位</div>-->
<!--            </div>-->

            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn layui-btn-fluid layui-btn-warm" lay-submit lay-filter="changeInfo">
                        修改信息
                    </button>
                </div>
            </div>

        </form>
    </div>
</div>

<script type="text/javascript">
    getUserInfo();
    let form = layui.form;
    form.on("submit(changeInfo)", function (data) {
        changeInfo();
        return false;
    });
    // form.verify({
    //     length6: function (value) {
    //         if (value.length < 6) {
    //             return "密码长度不能小于6";
    //         }
    //     },
    //     confirmPass: function (value) {
    //         if ($('input[name=password]').val() !== value) {
    //             return "两次输入密码不一致";
    //         }
    //     }
    // });
</script>
</body>
</html>